﻿using WindowsPhoneEssentials.Tasks;
using WindowsPhoneMVC.Interfaces;
using WindowsPhoneMVC.Navigation.Interfaces;

namespace WindowsPhoneMVC.Navigation
{
    public class NavigationContextFactory : INavigationContextFactory
    {
        private readonly IViewLocator viewLocator;
        private readonly ITaskManager taskManager;
        private readonly IPhoenixApplication phoenixApplication;

        public NavigationContextFactory(
            IViewLocator viewLocator,
            ITaskManager taskManager,
            IPhoenixApplication phoenixApplication)
        {
            this.viewLocator = viewLocator;
            this.taskManager = taskManager;
            this.phoenixApplication = phoenixApplication;
        }

        public NavigationContext Create(INavigator navigator, NavigationRequest request)
        {
            return new NavigationContext(navigator, viewLocator, taskManager, phoenixApplication, request);
        }
    }
}